package pers.chao.tool.infrastructure;

/**
 * Description: 老年人友好类
 * Java8四种函数式接口
 *
 * @author W.Chao
 * @date 2020/11/25 23:27
 **/
public final class FuncInterface {

	// *******************************
	// Function
	// *******************************
	@FunctionalInterface
	public interface T2R<T, R> {
		R apply(T t);
	}

	@FunctionalInterface
	public interface TU2R<T, U, R> {
		R apply(T t, U u);
	}

	// *******************************
	// Consumer
	// *******************************
	@FunctionalInterface
	public interface TnoR<T> {
		void consumer(T t);
	}

	@FunctionalInterface
	public interface TUnoR<T, U> {
		void consumer(T t, U u);
	}

	// *******************************
	// Supplier
	// *******************************
	@FunctionalInterface
	public interface returnT<T> {
		T supplier();
	}

	// *******************************
	// Operator
	// *******************************
	@FunctionalInterface
	public interface T2T<T> {
		T operator(T t);
	}

	@FunctionalInterface
	public interface TT2T<T> {
		T operator(T t, T other);
	}
}
